feat: price alert percentage feature#33339
Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 9f071af. Configure here.
a183fc3 to
bd02f31
Compare
There was a problem hiding this comment.
This is a common component to handle the input for both threshold and percent (the percent has a prefix and suffix).
There was a problem hiding this comment.
Dropped most of the code here and created new components for each alert type.
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Since there are no existing E2E smoke tests covering PriceAlerts and the changes don't affect any shared components that other smoke tests rely on, running zero E2E tags is the correct and efficient choice. Performance Test Selection: |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #33339 +/- ##
==========================================
+ Coverage 84.37% 84.41% +0.04%
==========================================
Files 6127 6147 +20
Lines 163530 163990 +460
Branches 39887 40048 +161
==========================================
+ Hits 137974 138437 +463
- Misses 16050 16053 +3
+ Partials 9506 9500 -6 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|




Description
Adds percent-change price alerts so users can get notified when a token moves up or down by a chosen percentage over a rolling 1h or 24h window, alongside existing absolute price-target alerts.
The create screen is refactored into a thin shell with an alert-type toggle (Price target / Price change) and dedicated forms (
AbsolutePriceAlertForm,PercentChangeAlertForm). Shared save behavior lives inuseAlertSaveFlow. Manage alerts lists both types, and the API layer adds/v1/alerts/percent-changeCRUD with alert-type routing and backward-compatible normalization (alerts missingtypedefault toabsolute_price).Changelog
CHANGELOG entry: Added percent-change price alerts so users can be notified when a token moves up or down by a set percentage over 1 hour or 24 hours
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/ASSETS-3593
Manual testing steps
Screenshots/Recordings
Before
N/A — percent-change alerts were not available (Price change was under development / placeholder). Absolute price-target create/manage unchanged in concept; attach prior screenshots if useful for comparison.
After
Simulator.Screen.Recording.-.iPhone.16.Pro.-.2026-07-15.at.15.57.34.mov
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Note
Medium Risk
New authenticated API surface and a large UI refactor around alert creation and management, though behavior is heavily tested and legacy absolute alerts remain backward compatible via normalization.
Overview
Adds percent-change price alerts (up/down % over 1h or 24h) next to existing absolute price target alerts, replacing the prior “under development” placeholder.
Create flow is split into a thin
CreatePriceAlertViewwith a Price target / Price change toggle (AlertTypeToggle) and two forms:AbsolutePriceAlertForm(moved keypad, quick % pills, duplicate-by-threshold) and newPercentChangeAlertForm(direction, period, % keypad, duplicate-by configuration tuple). Shared UI (AlertFormShell,AlertAmountInput,RecurringToggle, sliding pill toggles) anduseAlertSaveFlowcentralize submit, cache patch, analytics, toasts, and navigation. Route params shift fromexistingThresholdstoexistingAbsoluteAlerts/existingPercentAlerts; edit mode locks alert type.API gains
/v1/alerts/percent-changeCRUD,useSubmitPercentAlert,updateAlertByType/deleteAlertByType,normalizeAlerts(missingtype→absolute_price), and sharedassertOkResponse. Manage lists both types with formatted percent rows, passes split existing alerts when adding/editing, and emits percent-specific analytics on toggle/delete.Broad unit and component-view test coverage accompanies the refactor.
Reviewed by Cursor Bugbot for commit 577baf8. Bugbot is set up for automated code reviews on this repo. Configure here.